import dva  from 'dva';
import './index.less';
import createHistory from 'history/createBrowserHistory';
import createLoading from 'dva-loading';
import { message } from 'antd';
message.config({
  top:200
});
const ERROR_MSG_DURATION = 5; // 3 秒
// 1. Initialize
const app = dva(createLoading({
  effects: true,
}),{
  history: createHistory(),
  onError(e) {
    message.error(e.message, ERROR_MSG_DURATION);
  },

});

// 2. Plugins
// app.use(createLoading());

// 3. Model
app.model(require('./models/mflogin'));
app.model(require('./models/main'));

// 4. Router
app.router(require('./router'));

// 5. Start
app.start('#root');

